


  <script src="http://maps.google.com/maps?file=api&v=2&sensor=true&key=ABQIAAAAOwWCGwRYp76jMzcTHSAZJxRiKXZ7DXrLzxyWAdGBhEoVkrucchSRf8ZK-in_QWw4Q9UXcM6WsNif1Q"
    type="text/javascript">
  </script>
<div class="cities view">
<h2><?php  __('City');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $city['City']['id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($city['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $city['Country']['id'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Region'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($city['Region']['name'], array('controller'=> 'regions', 'action'=>'view', $city['Region']['id'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Ascii Name'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $city['City']['ascii_name']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $city['City']['name']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Population'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $city['City']['population']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Latitude'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $city['City']['latitude']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Longitude'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $city['City']['longitude']; ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Edit City', true), array('action'=>'edit', $city['City']['id'])); ?> </li>
		<li><?php echo $html->link(__('Delete City', true), array('action'=>'delete', $city['City']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $city['City']['id'])); ?> </li>
		<li><?php echo $html->link(__('List Cities', true), array('action'=>'index')); ?> </li>
		<li><?php echo $html->link(__('New City', true), array('action'=>'add')); ?> </li>
		<li><?php echo $html->link(__('List Countries', true), array('controller'=> 'countries', 'action'=>'index')); ?> </li>
		<li><?php echo $html->link(__('New Country', true), array('controller'=> 'countries', 'action'=>'add')); ?> </li>
		<li><?php echo $html->link(__('List Regions', true), array('controller'=> 'regions', 'action'=>'index')); ?> </li>
		<li><?php echo $html->link(__('New Region', true), array('controller'=> 'regions', 'action'=>'add')); ?> </li>
		<li><?php echo $html->link(__('List Profiles', true), array('controller'=> 'profiles', 'action'=>'index')); ?> </li>
		<li><?php echo $html->link(__('New Profile', true), array('controller'=> 'profiles', 'action'=>'add')); ?> </li>
		<li><?php echo $html->link(__('List Stories', true), array('controller'=> 'stories', 'action'=>'index')); ?> </li>
		<li><?php echo $html->link(__('New Story', true), array('controller'=> 'stories', 'action'=>'add')); ?> </li>
		<li><?php echo $html->link(__('List Users', true), array('controller'=> 'users', 'action'=>'index')); ?> </li>
		<li><?php echo $html->link(__('New User', true), array('controller'=> 'users', 'action'=>'add')); ?> </li>
	</ul>
</div>
<div id="map_canvas" style="width: 500px; height: 300px"></div>

<script>
function initialize() {
  var map = new GMap2(document.getElementById("map_canvas"));
  map.setCenter(new GLatLng(<?php echo $city['City']['latitude']; ?>, <?php echo $city['City']['longitude']; ?>), 14);
  map.setUIToDefault();
  map.setMapType(G_HYBRID_MAP);
  
  // Add 10 markers to the map at random locations
 // var bounds = map.getBounds();
 // var southWest = bounds.getSouthWest();
 // var northEast = bounds.getNorthEast();
 // var lngSpan = northEast.lng() - southWest.lng();
 // var latSpan = northEast.lat() - southWest.lat();
 // for (var i = 0; i < 10; i++) {
  //  var point = new GLatLng(southWest.lat() + latSpan * Math.random(),
   //     southWest.lng() + lngSpan * Math.random());
  //  map.addOverlay(new GMarker(point));
 //}
}
</script>

<div class="related">
	<h3><?php __('Related Profiles');?></h3>
	<?php if (!empty($city['Profile'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('User Id'); ?></th>
		<th><?php __('City Id'); ?></th>
		<th><?php __('About Me'); ?></th>
		<th><?php __('Date Of Birth'); ?></th>
		<th><?php __('Occupation'); ?></th>
		<th><?php __('Created'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($city['Profile'] as $profile):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $profile['id'];?></td>
			<td><?php echo $profile['user_id'];?></td>
			<td><?php echo $profile['city_id'];?></td>
			<td><?php echo $profile['about_me'];?></td>
			<td><?php echo $profile['date_of_birth'];?></td>
			<td><?php echo $profile['occupation'];?></td>
			<td><?php echo $profile['created'];?></td>
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller'=> 'profiles', 'action'=>'view', $profile['id'])); ?>
				<?php echo $html->link(__('Edit', true), array('controller'=> 'profiles', 'action'=>'edit', $profile['id'])); ?>
				<?php echo $html->link(__('Delete', true), array('controller'=> 'profiles', 'action'=>'delete', $profile['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $profile['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('New Profile', true), array('controller'=> 'profiles', 'action'=>'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php __('Related Stories');?></h3>
	<?php if (!empty($city['Story'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('City Id'); ?></th>
		<th><?php __('User Id'); ?></th>
		<th><?php __('Message'); ?></th>
		<th><?php __('Rating'); ?></th>
		<th><?php __('Num Ratings'); ?></th>
		<th><?php __('Created'); ?></th>
		<th><?php __('Latitude'); ?></th>
		<th><?php __('Longitude'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($city['Story'] as $story):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $story['id'];?></td>
			<td><?php echo $story['city_id'];?></td>
			<td><?php echo $story['user_id'];?></td>
			<td><?php echo $story['message'];?></td>
			<td><?php echo $story['rating'];?></td>
			<td><?php echo $story['num_ratings'];?></td>
			<td><?php echo $story['created'];?></td>
			<td><?php echo $story['latitude'];?></td>
			<td><?php echo $story['longitude'];?></td>
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller'=> 'stories', 'action'=>'view', $story['id'])); ?>
				<?php echo $html->link(__('Edit', true), array('controller'=> 'stories', 'action'=>'edit', $story['id'])); ?>
				<?php echo $html->link(__('Delete', true), array('controller'=> 'stories', 'action'=>'delete', $story['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $story['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('New Story', true), array('controller'=> 'stories', 'action'=>'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php __('Related Users');?></h3>
	<?php if (!empty($city['User'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('Username'); ?></th>
		<th><?php __('Email'); ?></th>
		<th><?php __('Password'); ?></th>
		<th><?php __('First Name'); ?></th>
		<th><?php __('Last Name'); ?></th>
		<th><?php __('Confirmed'); ?></th>
		<th><?php __('Confirmation Code'); ?></th>
		<th><?php __('Created'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($city['User'] as $user):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $user['id'];?></td>
			<td><?php echo $user['username'];?></td>
			<td><?php echo $user['email'];?></td>
			<td><?php echo $user['password'];?></td>
			<td><?php echo $user['first_name'];?></td>
			<td><?php echo $user['last_name'];?></td>
			<td><?php echo $user['confirmed'];?></td>
			<td><?php echo $user['confirmation_code'];?></td>
			<td><?php echo $user['created'];?></td>
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller'=> 'users', 'action'=>'view', $user['id'])); ?>
				<?php echo $html->link(__('Edit', true), array('controller'=> 'users', 'action'=>'edit', $user['id'])); ?>
				<?php echo $html->link(__('Delete', true), array('controller'=> 'users', 'action'=>'delete', $user['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $user['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('New User', true), array('controller'=> 'users', 'action'=>'add'));?> </li>
		</ul>
	</div>
</div>
<script type="text/javascript">
 initialize();
</script>
